Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added device= method to set the device based on name or number #8

Closed
wants to merge 1 commit into from

Conversation

mattsoldo
Copy link

For accounts with multiple devices, this allows a device to be specified by either name or number (0, 1, 2, etc):

@nest.device="Main"
@nest.temperature # => 68.0

@nest.device=1
@nest.temperature # => 65.0

I've tested this and it works great. Unfortunately I don't have specs for it.

@scut77
Copy link

scut77 commented Nov 17, 2013

This worked great!

Thanks

@@ -118,6 +139,10 @@ def fan_mode=(state)
) rescue nil
end

# def name
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to leave this in? If so, uncomment it else remove please.

Also, could you add tests for this PR?

@stevenpetryk
Copy link
Collaborator

While this is a useful feature, I think that, when using multiple devices, it would be more appropriate to have a Device class that has the methods that Nest currently has (such as temperature). It just feels a little clunky (i.e. not OOP style) to set a "device" attribute on a Nest instance to switch between devices.

For this reason, I think that this should be closed in favor of #12

@ericboehs
Copy link
Owner

@stevenpetryk Yeah. I agree. I think it may have worked at the time but #12 is much more OO.

@ericboehs ericboehs closed this Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants